package com.dom.domweb.modular.service;

import com.dom.common.model.standard.ResponseModel;
import com.dom.common.model.vo.sale.*;
import com.dom.domweb.common.RspModel;
import com.dom.domweb.consumer.SaleOrderConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description 销售订单服务service
 * @Author zhuwei
 * @Date 2018/11/18 上午0:38
 * @Version 1.0
 **/
@Service
public class SaleOrderService extends AbstractApproveService {

    @Autowired
    private SaleOrderConsumer saleOrderConsumer;

    /**
     * 销售订单列表查询
     * @param m019R
     * @return
     */
    public M019A findMarketOrderList(M019R m019R){
        return saleOrderConsumer.getSaleOrderList(m019R);
    }

    /**
     *  销售订单新增
     * @param request
     * @return
     */
    public String insertSaleOrder(M010R request){
        return saleOrderConsumer.insertSaleOrder(request);
    }

    public M013A findUpdateSaleOrderPage(String keyId){
        M013R request = new M013R();
        request.setKeyId(keyId);
        return saleOrderConsumer.getMarketOrderDetailList(request);
    }

    public boolean saleOrderDel(String keyId){
        return saleOrderConsumer.saleOrderDel(keyId);
    }

    public RspModel saleOrderModify(M012R request){
        ResponseModel rspModel = saleOrderConsumer.saleOrderModify(request);
        RspModel model = new RspModel(rspModel.getRspCode(),rspModel.getRspMsg());
        return model;
    }
}
